/*
 * @Author: yyf
 * @Date: 2018-04-27
 * @description: 事件--投资方
*/

import { apiHttp } from '../../apiHttp';
import investApi from '../../../api/event/eventInvestController.api';
import { JsonResult, EventInvestDto } from '../../../api/Interface';
import { EventPublicSearchDto } from '../Interface';

export default {
    // 获取投资方列表
    getInvestorEventList: async (investorEventList: EventPublicSearchDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(investApi.eventInvestPage, investorEventList);
        return res;
    },
    // 添加投资方
    addInvestorEvent: async (addInvestorEvent: EventInvestDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(investApi.saveEventInvest, addInvestorEvent);
        return res;
    },
    // 编辑投资方
    updateEventInvest: async (addInvestorEvent: EventInvestDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(investApi.updateEventInvest, addInvestorEvent);
        return res;
    },
    // 删除投资方
    deleteEventInvest: async (id: number): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(investApi.deleteEventInvest, {id});
        return res;
    },
};